//
//  RetailTool.swift
//  Retail
//
//  Created by zhangjikuan on 2020/8/28.
//  Copyright © 2020 aqdeal. All rights reserved.
//

import Foundation
import UIKit

protocol RetailTool {
    
    static func execute(_ target:Any ) -> Void
}

class RetailToolChangeRootController: RetailTool {
    static func execute(_ target: Any) {
        let transtition = CATransition()
        transtition.duration = 0.5
        transtition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut)
        UIApplication.shared.keyWindow?.layer.add(transtition, forKey: "animation")
        UIApplication.shared.keyWindow?.rootViewController = target as? UIViewController
    }
}

